﻿using Fungus;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Gun : MonoBehaviour
{
    GameObject skill;
    Flowchart fungus;
    GameObject data;
    GameObject canvas;
    int dialogueValue;
    // Start is called before the first frame update
    void Start()
    {
        data = GameObject.FindGameObjectWithTag("Data");
        canvas = GameObject.FindGameObjectWithTag("Canvas");
        skill = GameObject.FindGameObjectWithTag("Skill");
        fungus = skill.GetComponent<Flowchart>();
        dialogueValue = data.GetComponent<GameData>().dialogueValue;
    }

    //隐者，枪王
    private void OnMouseDown()
    {
        dialogueValue = data.GetComponent<GameData>().dialogueValue;
        print(dialogueValue);
        switch (dialogueValue)
        {
            case 12:
                fungus.ExecuteBlock("Queue12");
                data.GetComponent<GameData>().dialogueValue++; break;
            case 37:
                fungus.ExecuteBlock("Gun"); break;
        }
        canvas.transform.GetChild(7).gameObject.SetActive(true);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
